import Vue from "vue"
import VueRouter from "vue-router"
import Home from "../Views/Home.vue"
import User from "../Views/User.vue"
import Main from "../Views/Main.vue"
import Mall from "../Views/Mall.vue"
import PageOne from "../Views/PageOne.vue"
import PageTwo from "../Views/PageTwo.vue"
import Login from "../Views/Login.vue"

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Main,
    name: 'Main',
    redirect: 'home',//重定向
    children: [
      // { path: 'home', name: 'home', component: Home }, //首页
      // { path: 'user', name: 'user', component: User }, //用户管理
      // { path: 'mall', name: 'mall', component: Mall }, //商品管理
      // { path: 'page1', name: 'page1', component: PageOne }, //页面1
      // { path: 'page2', name: 'page2', component: PageTwo }  //页面2
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  }
]
const router = new VueRouter({
  routes // (缩写) 相当于 routes: routes
})

export default router



